<?php
//Add thumnai with post
//add_theme_support('post-thumbnails', array('post'));
//Add thumnai with page
//add_theme_support('post-thumbnails', array('page'));
/** arena_softech options */
add_theme_support('post-thumbnails');

if ( function_exists('register_sidebar') )
register_sidebar(array('name'=>'primaryTopLeft1',
'before_widget' => '<div class="widget">',
'after_widget' => '</div>',
'before_title' => '<h2 class="postTitle">',
'after_title' => '</h2>',
));
if ( function_exists('register_sidebar') )
register_sidebar(array('name'=>'primaryTopLeft2',
'before_widget' => '<div class="widget">',
'after_widget' => '</div>',
'before_title' => '<h2 class="postTitle">',
'after_title' => '</h2>',
));
if ( function_exists('register_sidebar') )
register_sidebar(array('name'=>'primaryTopLeft_R',
'before_widget' => '<div class="widget">',
'after_widget' => '</div>',
'before_title' => '<h2 class="postTitle">',
'after_title' => '</h2>',
));
if ( function_exists('register_sidebar') )
register_sidebar(array('name'=>'primaryTopMid1',
'before_widget' => '<div class="widget">',
'after_widget' => '</div>',
'before_title' => '<h2 class="postTitle">',
'after_title' => '</h2>',
));
if ( function_exists('register_sidebar') )
register_sidebar(array('name'=>'primaryTopMid2',
'before_widget' => '<div class="widget">',
'after_widget' => '</div>',
'before_title' => '<h2 class="postTitle">',
'after_title' => '</h2>',
));
if ( function_exists('register_sidebar') )
register_sidebar(array('name'=>'primaryTopMid_R',
'before_widget' => '<div class="widget">',
'after_widget' => '</div>',
'before_title' => '<h2 class="postTitle">',
'after_title' => '</h2>',
));
if ( function_exists('register_sidebar') )
register_sidebar(array('name'=>'Mainpage-TopSidebar1',
'before_widget' => '<div class="widget">',
'after_widget' => '</div>',
'before_title' => '<h2 class="widget_title">',
'after_title' => '</h2>',
));
if ( function_exists('register_sidebar') )
register_sidebar(array('name'=>'Mainpage-TopSidebar2',
'before_widget' => '<div class="widget">',
'after_widget' => '</div>',
'before_title' => '<h2 class="widget_title">',
'after_title' => '</h2>',
));
if ( function_exists('register_sidebar') )
register_sidebar(array('name'=>'Mainpage-TopSidebar_R',
'before_widget' => '<div class="widget">',
'after_widget' => '</div>',
'before_title' => '<h2 class="widget_title">',
'after_title' => '</h2>',
));
if ( function_exists('register_sidebar') )
register_sidebar(array('name'=>'MediaBar_R',
'before_widget' => '<div class="widget widgetMedia">',
'after_widget' => '</div>',
'before_title' => '<h2 class="postTitle">',
'after_title' => '</h2>',
));
if ( function_exists('register_sidebar') )
register_sidebar(array('name'=>'primaryBottomAd1',
'before_widget' => '<div class="widget">',
'after_widget' => '</div>',
'before_title' => '<h2 class="postTitle">',
'after_title' => '</h2>',
));
if ( function_exists('register_sidebar') )
register_sidebar(array('name'=>'primaryBottomAd2',
'before_widget' => '<div class="widget">',
'after_widget' => '</div>',
'before_title' => '<h2 class="postTitle">',
'after_title' => '</h2>',
));
if ( function_exists('register_sidebar') )
register_sidebar(array('name'=>'primaryBottomAd_R',
'before_widget' => '<div class="widget">',
'after_widget' => '</div>',
'before_title' => '<h2 class="postTitle">',
'after_title' => '</h2>',
));
if ( function_exists('register_sidebar') )
register_sidebar(array('name'=>'primaryBottomTab1_R',
'before_widget' => '<div class="widget">',
'after_widget' => '</div>',
'before_title' => '<h2 class="postTitle">',
'after_title' => '</h2>',
));
if ( function_exists('register_sidebar') )
register_sidebar(array('name'=>'primaryBottomTab2_R',
'before_widget' => '<div class="widget">',
'after_widget' => '</div>',
'before_title' => '<h2 class="postTitle">',
'after_title' => '</h2>',
));
if ( function_exists('register_sidebar') )
register_sidebar(array('name'=>'primaryBottomTab3_R',
'before_widget' => '<div class="widget">',
'after_widget' => '</div>',
'before_title' => '<h2 class="postTitle">',
'after_title' => '</h2>',
));
if ( function_exists('register_sidebar') )
register_sidebar(array('name'=>'primaryBottomTab4_R',
'before_widget' => '<div class="widget">',
'after_widget' => '</div>',
'before_title' => '<h2 class="postTitle">',
'after_title' => '</h2>',
));
if ( function_exists('register_sidebar') )
register_sidebar(array('name'=>'primaryBottomTab5_R',
'before_widget' => '<div class="widget">',
'after_widget' => '</div>',
'before_title' => '<h2 class="postTitle">',
'after_title' => '</h2>',
));
if ( function_exists('register_sidebar') )
register_sidebar(array('name'=>'subNewsLeftTop_R',
'before_widget' => '<div class="widget">',
'after_widget' => '</div>',
'before_title' => '<h2 class="postTitle">',
'after_title' => '</h2>',
));
if ( function_exists('register_sidebar') )
register_sidebar(array('name'=>'subNewsRightTop_R',
'before_widget' => '<div class="widget">',
'after_widget' => '</div>',
'before_title' => '<h2 class="postTitle">',
'after_title' => '</h2>',
));
if ( function_exists('register_sidebar') )
register_sidebar(array('name'=>'subNewsLeftBottom_R',
'before_widget' => '<div class="widget">',
'after_widget' => '</div>',
'before_title' => '<h2 class="postTitle">',
'after_title' => '</h2>',
));
if ( function_exists('register_sidebar') )
register_sidebar(array('name'=>'subNewsRightBottom_R',
'before_widget' => '<div class="widget">',
'after_widget' => '</div>',
'before_title' => '<h2 class="postTitle">',
'after_title' => '</h2>',
));
if ( function_exists('register_sidebar') )
register_sidebar(array('name'=>'Mainpage-bottomSidebar1',
'before_widget' => '<div class="widget">',
'after_widget' => '</div>',
'before_title' => '<h2 class="widget_title">',
'after_title' => '</h2>',
));
if ( function_exists('register_sidebar') )
register_sidebar(array('name'=>'Mainpage-bottomSidebar2',
'before_widget' => '<div class="widget">',
'after_widget' => '</div>',
'before_title' => '<h2 class="widget_title">',
'after_title' => '</h2>',
));
if ( function_exists('register_sidebar') )
register_sidebar(array('name'=>'Mainpage-bottomSidebar_R',
'before_widget' => '<div class="widget">',
'after_widget' => '</div>',
'before_title' => '<h2 class="widget_title">',
'after_title' => '</h2>',
));
if ( function_exists('register_sidebar') )
register_sidebar(array('name'=>'InnerSidebarTop',
'before_widget' => '<div class="widget">',
'after_widget' => '</div>',
'before_title' => '<h2 class="widget_title">',
'after_title' => '</h2>',
));
if ( function_exists('register_sidebar') )
register_sidebar(array('name'=>'InnerSidebarBottom',
'before_widget' => '<div class="widget">',
'after_widget' => '</div>',
'before_title' => '<h2 class="widget_title">',
'after_title' => '</h2>',
));

#Theme Functions
function string_limit_words($string, $word_limit)
{
$words = explode(' ', $string, ($word_limit + 1));
if(count($words) > $word_limit)
array_pop($words);
return implode(' ', $words);
}
#Include translation file
include (TEMPLATEPATH . '/translations/current.php');
$GLOBALS['content_width'] = 623;
# Template Location
define('THEME', get_bloginfo('template_url'), true);
# JS files location
define('THEME_JS', THEME . '/includes', true);
wp_enqueue_script('contentslider', THEME_JS .'/contentslider.js');
wp_enqueue_script('jquery', THEME_JS .'/jquery-1.3.2.min.js');
wp_enqueue_script('jqueryslidemenu', THEME_JS .'/jqueryslidemenu/jqueryslidemenu.js');
wp_enqueue_script('tabs', THEME_JS .'/tabs/tabcontent.js');
	
class ControlPanel {

	/********************************************************
	Create a unique array that contains all theme settings
	********************************************************/
	var $default_settings = Array(
		'style' => 'default',
		'enableLogo' => 0,
		'enableLogoFot' => 0,
		'logoUrl' => 'http://',
		'logoUrlFot' => 'http://',
		'titleSiteNameFirstRow' => 'TRANSCRIPT',
		'titleSiteNameSecondRow' => 'ONLINE NEWSPAPER',
		'logoMarginTop' => '30',
		'logoMarginLeft' => '30',
		'order' => 'ASC',
		'orderBy' => 'ID',
		'feaPostCount' => '6',
		'recentPosts' => '6',
		'featuredCatID' => '1',
		'fea2PostCount' => '1',
		'fea2CatID' => '1',
		'fea3CatID' => '1',
		'fea3PostCount' => '4',
		'mediaGalCatID' => '1',
		'enableMediaGallery' => 1,
		'feaTab1CatID' => '1',
		'feaTab2CatID' => '1',
		'feaTab3CatID' => '1',
		'feaTab4CatID' => '1',
		'feaTab5CatID' => '1',
		'subNewsTopCatID' => '1',
		'subNewsBotCatID' => '1',
		'sideNewsCatID' => '1',
		'postCountBot1' => '1',
		'postCountBot2' => '2',
		'postCountBot3' => '5',
		'postCountBot4' => '2',
		'postCountBot5' => '5',
		'postCountBot6' => '1',
		'postCountBot7' => '6',		
		'enableDate' => 1,
		'enableAName' => 1,
		'dateFormat' => 'F j Y',
		'dateFormatS' => 'l, F jS, Y',
		'dateFormatA' => 'F jS, Y',
		'timeFormat' => 'h:i a',
		'rotate' => 'true',
		'rotatetime' => 15000,
		'enable728' => 0,
		'enable468' => 1,
		'300x250_middle' => '300x250 [Main Page Mid Ad]',
		'300x250InnerTop' => '300x250 [Inner sidebar Top Ad]',
		'300x250_bottom' => '300x250 ad code [Main page below the photo gallery]',
		'300x250_up' => '300x250 ad code [Main page above the photo gallery]',
		'300x250InnerBot' => '300x250 [Inner sidebar Bottom Ad]',
		'adh468x60' => '468x60 ad code [Site Wide - Header]',
		'adi468x60' => '468x60 ad code [Article page - Between comment and article]',
		'ad728x90' => '728x90 ad code [Header - SiteWide]',
	);
	
	var $options;
	function ControlPanel() {
 	add_action('admin_menu', array(&$this, 'add_menu'));
 	add_action('admin_head', array(&$this, 'admin_head'));

 	if (!is_array(get_option('Transcript')))
 	add_option('Transcript', $this->default_settings);
 
 	$this->options = get_option('Transcript');
	}

 	function add_menu() {add_theme_page('Daily-Vn Settings', 'Daily-Vn Settings', 'edit_themes', "Transcript", array(&$this, 'optionsmenu'));	}
 	function admin_head() {	print '	<style type="text/css" media="screen">@import url( ' .get_template_directory_uri(). '/includes/controlpanel.css );</style>';}
	
	function optionsmenu() {
	if ($_POST['ss_action'] == 'save') {
		$this->options["style"] = $_POST['cp_style'];
		$this->options["enableLogo"] = $_POST['cp_enableLogo'];
		$this->options["enableLogoFot"] = $_POST['cp_enableLogoFot'];
		$this->options["titleSiteNameFirstRow"] = $_POST['cp_titleSiteNameFirstRow'];
		$this->options["titleSiteNameSecondRow"] = $_POST['cp_titleSiteNameSecondRow'];
		$this->options["logoUrl"] = $_POST['cp_logoUrl'];
		$this->options["logoUrlFot"] = $_POST['cp_logoUrlFot'];
		$this->options["recentPosts"] = $_POST['cp_recentPosts'];
		$this->options["logoMarginTop"] = $_POST['cp_logoMarginTop'];
		$this->options["logoMarginLeft"] = $_POST['cp_logoMarginLeft'];
		$this->options["orderBy"] = $_POST['cp_orderBy'];
		$this->options["order"] = $_POST['cp_order'];
		$this->options["excludeCategories"] = $_POST['cp_excludeCategories'];
		$this->options["excludePageNav"] = $_POST['cp_excludePageNav'];
		$this->options["excludePageFot"] = $_POST['cp_excludePageFot'];		
		$this->options["featuredCatID"] = $_POST['cp_featuredCatID'];
		$this->options["fea2CatID"] = $_POST['cp_fea2CatID'];
		$this->options["fea3CatID"] = $_POST['cp_fea3CatID'];
		$this->options["feaPostCount"] = $_POST['cp_feaPostCount'];
		$this->options["fea2PostCount"] = $_POST['cp_fea2PostCount'];
		$this->options["fea3PostCount"] = $_POST['cp_fea3PostCount'];
		$this->options["mediaGalCatID"] = $_POST['cp_mediaGalCatID'];
		$this->options["enableMediaGallery"] = $_POST['cp_enableMediaGallery'];
		$this->options["feaTab1CatID"] = $_POST['cp_feaTab1CatID'];
		$this->options["feaTab2CatID"] = $_POST['cp_feaTab2CatID'];
		$this->options["feaTab3CatID"] = $_POST['cp_feaTab3CatID'];
		$this->options["feaTab4CatID"] = $_POST['cp_feaTab4CatID'];
		$this->options["feaTab5CatID"] = $_POST['cp_feaTab5CatID'];
		$this->options["subNewsTopCatID"] = $_POST['cp_subNewsTopCatID'];
		$this->options["subNewsBotCatID"] = $_POST['cp_subNewsBotCatID'];
		$this->options["sideNewsCatID"] = $_POST['cp_sideNewsCatID'];
		$this->options["postCountBot1"] = $_POST['cp_postCountBot1'];
		$this->options["postCountBot2"] = $_POST['cp_postCountBot2'];
		$this->options["postCountBot3"] = $_POST['cp_postCountBot3'];
		$this->options["postCountBot4"] = $_POST['cp_postCountBot4'];
		$this->options["postCountBot5"] = $_POST['cp_postCountBot5'];
		$this->options["postCountBot6"] = $_POST['cp_postCountBot6'];
		$this->options["postCountBot7"] = $_POST['cp_postCountBot7'];
		$this->options["enableDate"] = $_POST['cp_enableDate'];
		$this->options["enableAName"] = $_POST['cp_enableAName'];
		$this->options["dateFormat"] = $_POST['cp_dateFormat'];
		$this->options["dateFormatS"] = $_POST['cp_dateFormatS'];
		$this->options["dateFormatA"] = $_POST['cp_dateFormatA'];
		$this->options["timeFormat"] = $_POST['cp_timeFormat'];
		$this->options["feedURL"] = $_POST['cp_feedURL'];
		$this->options["tabA1"] = $_POST['cp_tabA1'];
		$this->options["tabA2"] = $_POST['cp_tabA2'];
		$this->options["tabA3"] = $_POST['cp_tabA3'];
		$this->options["tabA4"] = $_POST['cp_tabA4'];
		$this->options["tabA5"] = $_POST['cp_tabA5'];
		$this->options["rotate"] = $_POST['cp_rotate'];
		$this->options["rotatetime"] = $_POST['cp_rotatetime'];
		$this->options["enable728"] = $_POST['cp_enable728'];
		$this->options["enable468"] = $_POST['cp_enable468'];
		$this->options["topBoxTitle"] = $_POST['cp_topBoxTitle'];
		$this->options["botBoxTitle"] = $_POST['cp_botBoxTitle'];
		$this->options["300x250_middle"] = stripslashes($_POST['cp_300x250_middle']);
		$this->options["analytics"] = stripslashes($_POST['cp_analytics']);
		$this->options["300x250_bottom"] = stripslashes($_POST['cp_300x250_bottom']);
		$this->options["300x250_up"] = stripslashes($_POST['cp_300x250_up']);
		$this->options["adh468x60"] = stripslashes($_POST['cp_adh468x60']);
		$this->options["300x250InnerTop"] = stripslashes($_POST['cp_300x250InnerTop']);
		$this->options["300x250InnerBot"] = stripslashes($_POST['cp_300x250InnerBot']);
		$this->options["adi468x60"] = stripslashes($_POST['cp_adi468x60']);
		$this->options["ad728x90"] = stripslashes($_POST['cp_ad728x90']);
		update_option('Transcript', $this->options);
		echo '<div class="updated fade" id="message" style="background-color: rgb(255, 251, 204); width: 500px; margin-left: 50px"><p>Daily VN settings <strong>saved</strong>.</p></div>';
		} 
	?>

	<div id="optionsForm">
		<div class="icon32" id="icon-options-general"><br></div>
			<h2 class="h2_title_option"><?php echo 'Theme Daily VN Option'; ?></h2>
		<?php if(is_admin()){	?>	
			<link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/lib/css/admin-tabs.css" type="text/css" />
			<script type="text/javascript" src="<?php bloginfo('template_url'); ?>/lib/js/jquery-1.5.1.min.js"></script>
			<script type="text/javascript" src="<?php bloginfo('template_url'); ?>/lib/js/jquery.ui.core.js"></script>
			<script type="text/javascript" src="<?php bloginfo('template_url'); ?>/lib/js/jquery.ui.widget.js"></script>
			<script type="text/javascript" src="<?php bloginfo('template_url'); ?>/lib/js/jquery.ui.tabs.js"></script>
			<script>
				$(function() {
					$( "#tabs" ).tabs();
				});
			</script>
		<?php } ?>
	
		<form action="" method="post" id="themeform">
		
			<input type="hidden" id="ss_action" name="ss_action" value="save">	
			<p><input type="submit" value="Save Changes &raquo;" name="cp_save" class="button-primary" /></p>
			
			<div id="tabs" class="ui-tabs ui-widget ui-widget-content ui-corner-all">
				<ul class="ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all">
						<li class="ui-state-default ui-corner-top ui-tabs-selected ui-state-active"><a href="#show_post_option">Config Opntion Theme</a></li>				
						<li class="ui-state-default ui-corner-top"><a href="#headway-system-info-tab">System Info</a></li>	
									<li class="ui-state-default ui-corner-top"><a href="#headway-system-help-tab">Help Config</a></li>	
				</ul>
				<!-- Start System Info Panel -->
				<div class="tab ui-tabs-panel ui-widget-content ui-corner-bottom" id="show_post_option">

					<div id="panelLeft">
						<h2>Select a style (color scheme)</h2>
						<div class="innerBox">						
							<select name="cp_style" class="selectm">
								<?php
								$dirPath = TEMPLATEPATH. '/styles/';
								if ($handle = opendir($dirPath)) {
								while (false !== ($file = readdir($handle))) {
								if ($file != "." && $file != "..") {
								if (is_dir("$dirPath/$file")) {
								?>
								<option value="<?php echo $file; ?>"<?php selected($file, $this->options["style"]); ?>><?php echo ucfirst($file); ?></option>
								<?php } } } closedir($handle); } ?>
							</select>
						</div>
						<h2>Google Analytics/Stat Tracker Code</h2>
						<div class="innerBox">
							<textarea class="textarea" name="cp_analytics" id="cp_analytics"><?php echo stripslashes($this->options["analytics"]); ?></textarea>
						</div>			
					
						<h2>Setup Header</h2>
						<div class="innerBox">			
							<select name="cp_enableLogo" class="selectm">
							<option value="1"<?php selected(1, $this->options["enableLogo"]); ?>>Image based logo</option>
							<option value="0"<?php selected(0, $this->options["enableLogo"]); ?>>Text-based logo</option>
							</select>			
							
							<h3>If text logo is activated</h3>
							<input class="inputN" name="cp_titleSiteNameFirstRow" id="cp_titleSiteNameFirstRow" type="text" value="<?php echo $this->options["titleSiteNameFirstRow"]; ?>" /><label for="cp_titleSiteNameFirstRow">Sitename Row #1</label><br />
							<input class="inputN" name="cp_titleSiteNameSecondRow" id="cp_titleSiteNameSecondRow" type="text" value="<?php echo $this->options["titleSiteNameSecondRow"]; ?>" /><label for="cp_titleSiteNameSecondRow">Sitename Row #2</label><br /><br />
							<h3>If Image logo is activated</h3>
							<input class="inputN" name="cp_logoUrl" id="cp_logoUrl" type="text" value="<?php echo $this->options["logoUrl"]; ?>" /><label for="cp_logoUrl">Logo URL [Max Width: 460px - Max Height:115px]</label><br /><br />
							
							
							<h3>Set spacing between logo and top &amp; left corners</h3>
							<input class="inputN" style="width:40px;" name="cp_logoMarginTop" id="cp_logoMarginTop" type="text" value="<?php echo $this->options["logoMarginTop"]; ?>" /><label for="cp_logoMarginTop">px [space between logo and top line]</label><br />
							<input class="inputN" style="width:40px;" name="cp_logoMarginLeft" id="cp_logoMarginLeft" type="text" value="<?php echo $this->options["logoMarginLeft"]; ?>" /><label for="cp_logoMarginLeft">px [space between logo and left corner]</label><br /><br />
						</div>

						<h2>Setup Navigation</h2>
						<div class="innerBox">
							<p><strong>Setup Navigation</strong>: Exclude specific category/page from navigation by using their ID's <a href="http://www.gabfirethemes.com/how-to-check-category-ids/" target="_blank">Tutorial: How to check category ID's?</a></p>
							<div class="innerBoxH">
							<h3>Setup Categories</h3>
							<p><input class="inputN" name="cp_excludeCategories" id="cp_excludeCategories" type="text" value="<?php echo $this->options["excludeCategories"]; ?>" /><label for="cp_excludeCategories">ID number of categories to be exluded from navigation bar (separate with comma and leave no space if you enter more than one category)</label></p>
							<p><input class="inputN" name="cp_orderBy" id="cp_orderBy" type="text" value="<?php echo $this->options["orderBy"]; ?>" /><label for="cp_orderBy">Sort categories alphabetically, by unique Category ID, or by the count of posts in that category. Options are <strong>ID</strong>, <strong>name</strong>, <strong>count</strong></label></p>
							<p><input class="inputN" name="cp_order" id="cp_order" type="text" value="<?php echo $this->options["order"]; ?>" /><label for="cp_order">Sort categories either ascending or descending Options are: <strong>ASC</strong>, <strong>DESC</strong></label></p>
							</div>
							<div class="innerBoxH">
							<h3>Setup Pages</h3>
							<p><input class="inputN" name="cp_excludePageNav" id="cp_excludePageNav" type="text" value="<?php echo $this->options["excludePageNav"]; ?>" /><label for="cp_excludePageNav">ID number of pages to be exluded from top navigation (separate with comma and leave no space if you add more than one category)</label></p>
							<p><input class="inputN" name="cp_excludePageFot" id="cp_excludePageFot" type="text" value="<?php echo $this->options["excludePageFot"]; ?>" /><label for="cp_excludePageFot">ID number of pages to be exluded from footer navigation (separate with comma and leave no space if you add more than one category)</label></p>
							</div>
						</div>

						<h2>Setup Post Counts</h2>
						<div class="innerBox">
							<input class="inputID" name="cp_feaPostCount" id="cp_feaPostCount" type="text" value="<?php echo $this->options["feaPostCount"]; ?>" /><label for="cp_feaPostCount">Number of posts to be displayed at featured slider (Default 6)</label><br />
							<input class="inputID" name="cp_fea2PostCount" id="cp_fea2PostCount" type="text" value="<?php echo $this->options["fea2PostCount"]; ?>" /><label for="cp_fea2PostCount">Number of posts to be displayed below featured slider (Default 1)</label><br />
							<input class="inputID" name="cp_fea3PostCount" id="cp_fea3PostCount" type="text" value="<?php echo $this->options["fea3PostCount"]; ?>" /><label for="cp_fea3PostCount">Number of posts to be displayed at the right hand of featured slider (Default 4)</label><br />			
							<input class="inputID" name="cp_postCountBot1" id="cp_postCountBot1" type="text" value="<?php echo $this->options["postCountBot1"]; ?>" /><label for="cp_postCountBot1">Number of posts to be displayed with big thumbnail in secondary content / upper box (Default 1)</label><br />
							<input class="inputID" name="cp_postCountBot2" id="cp_postCountBot2" type="text" value="<?php echo $this->options["postCountBot2"]; ?>" /><label for="cp_postCountBot2">Number of posts to be displayed with small thumbnail in secondary content / upper box (Default 2)</label><br />
							<input class="inputID" name="cp_postCountBot3" id="cp_postCountBot3" type="text" value="<?php echo $this->options["postCountBot3"]; ?>" /><label for="cp_postCountBot3">Number of posts to be displayed without excerpt in secondary content / upper box (Default 5)</label><br />
							<input class="inputID" name="cp_postCountBot4" id="cp_postCountBot4" type="text" value="<?php echo $this->options["postCountBot4"]; ?>" /><label for="cp_postCountBot4">Number of posts to be displayed with small thumbnail in secondary content / bottom box(Default 2)</label><br />
							<input class="inputID" name="cp_postCountBot5" id="cp_postCountBot5" type="text" value="<?php echo $this->options["postCountBot5"]; ?>" /><label for="cp_postCountBot5">Number of posts to be displayed without excerpt in secondary content / bottom box (Default 5)</label><br />
							<input class="inputID" name="cp_postCountBot6" id="cp_postCountBot6" type="text" value="<?php echo $this->options["postCountBot6"]; ?>" /><label for="cp_postCountBot6">Number of posts to be displayed with big thumbnail in secondary content / bottom box (Default 1)</label><br />
							<input class="inputID" name="cp_postCountBot7" id="cp_postCountBot7" type="text" value="<?php echo $this->options["postCountBot7"]; ?>" /><label for="cp_postCountBot7">Number of posts to be displayed on sidebar (Default 6)</label><br />
						</div>
						
						<h2>Setup Categories</h2>
						<div class="innerBox">
							<select name="cp_featuredCatID" class="selectCat">
							<?php $cats = get_categories('hide_empty=0'); foreach($cats as $cat) { ?>
							<option value="<?php echo $cat->cat_ID; ?>"<?php selected($cat->cat_ID, $this->options["featuredCatID"]); ?>><?php echo $cat->cat_name; ?></option>
							<?php } ?>
							</select>
							<label for="cp_featuredCatID">Featured section category</label><br />

							<select name="cp_fea2CatID" class="selectCat">
							<?php $cats = get_categories('hide_empty=0'); foreach($cats as $cat) { ?>
							<option value="<?php echo $cat->cat_ID; ?>"<?php selected($cat->cat_ID, $this->options["fea2CatID"]); ?>><?php echo $cat->cat_name; ?></option>
							<?php } ?>
							</select>
							<label for="cp_fea2CatID">Below featured slider</label><br />

							<select name="cp_fea3CatID" class="selectCat">
							<?php $cats = get_categories('hide_empty=0'); foreach($cats as $cat) { ?>
							<option value="<?php echo $cat->cat_ID; ?>"<?php selected($cat->cat_ID, $this->options["fea3CatID"]); ?>><?php echo $cat->cat_name; ?></option>
							<?php } ?>
							</select>
							<label for="cp_fea3CatID">The right hand of featured slider</label><br />

							<select name="cp_feaTab1CatID" class="selectCat">
							<?php $cats = get_categories('hide_empty=0'); foreach($cats as $cat) { ?>
							<option value="<?php echo $cat->cat_ID; ?>"<?php selected($cat->cat_ID, $this->options["feaTab1CatID"]); ?>><?php echo $cat->cat_name; ?></option>
							<?php } ?>
							</select>
							<label for="cp_feaTab1CatID">Featured Tab #1</label><br />

							<select name="cp_feaTab2CatID" class="selectCat">
							<?php $cats = get_categories('hide_empty=0'); foreach($cats as $cat) { ?>
							<option value="<?php echo $cat->cat_ID; ?>"<?php selected($cat->cat_ID, $this->options["feaTab2CatID"]); ?>><?php echo $cat->cat_name; ?></option>
							<?php } ?>
							</select>
							<label for="cp_feaTab2CatID">Featured Tab #2</label><br />

							<select name="cp_feaTab3CatID" class="selectCat">
							<?php $cats = get_categories('hide_empty=0'); foreach($cats as $cat) { ?>
							<option value="<?php echo $cat->cat_ID; ?>"<?php selected($cat->cat_ID, $this->options["feaTab3CatID"]); ?>><?php echo $cat->cat_name; ?></option>
							<?php } ?>
							</select>
							<label for="cp_feaTab3CatID">Featured Tab #3</label><br />

							<select name="cp_feaTab4CatID" class="selectCat">
							<?php $cats = get_categories('hide_empty=0'); foreach($cats as $cat) { ?>
							<option value="<?php echo $cat->cat_ID; ?>"<?php selected($cat->cat_ID, $this->options["feaTab4CatID"]); ?>><?php echo $cat->cat_name; ?></option>
							<?php } ?>
							</select>
							<label for="cp_feaTab4CatID">Featured Tab #4</label><br />

							<select name="cp_feaTab5CatID" class="selectCat">
							<?php $cats = get_categories('hide_empty=0'); foreach($cats as $cat) { ?>
							<option value="<?php echo $cat->cat_ID; ?>"<?php selected($cat->cat_ID, $this->options["feaTab5CatID"]); ?>><?php echo $cat->cat_name; ?></option>
							<?php } ?>
							</select>
							<label for="cp_feaTab5CatID">Featured Tab #5</label><br />

							<select name="cp_subNewsTopCatID" class="selectCat">
							<?php $cats = get_categories('hide_empty=0'); foreach($cats as $cat) { ?>
							<option value="<?php echo $cat->cat_ID; ?>"<?php selected($cat->cat_ID, $this->options["subNewsTopCatID"]); ?>><?php echo $cat->cat_name; ?></option>
							<?php } ?>
							</select>
							<label for="cp_subNewsTopCatID">Secondary content top box</label><br />

							<select name="cp_subNewsBotCatID" class="selectCat">
							<?php $cats = get_categories('hide_empty=0'); foreach($cats as $cat) { ?>
							<option value="<?php echo $cat->cat_ID; ?>"<?php selected($cat->cat_ID, $this->options["subNewsBotCatID"]); ?>><?php echo $cat->cat_name; ?></option>
							<?php } ?>
							</select>
							<label for="cp_subNewsBotCatID">Secondary content bottom box</label><br />

							<select name="cp_sideNewsCatID" class="selectCat">
							<?php $cats = get_categories('hide_empty=0'); foreach($cats as $cat) { ?>
							<option value="<?php echo $cat->cat_ID; ?>"<?php selected($cat->cat_ID, $this->options["sideNewsCatID"]); ?>><?php echo $cat->cat_name; ?></option>
							<?php } ?>
							</select>
							<label for="cp_sideNewsCatID">Secondary content sidebar news</label><br />


							<div class="innerBoxH">
								<h3>MEDIA GALLERY MODULE</h3>
								<select name="cp_enableMediaGallery" class="selectCat">
								<option value="1"<?php selected(1, $this->options["enableMediaGallery"]); ?>>Enable Media gallery</option>
								<option value="0"<?php selected(0, $this->options["enableMediaGallery"]); ?>>Disable Media gallery</option>
								</select><br/>
								
								<select name="cp_mediaGalCatID" class="selectCat">
								<?php $cats = get_categories('hide_empty=0'); foreach($cats as $cat) { ?>
								<option value="<?php echo $cat->cat_ID; ?>"<?php selected($cat->cat_ID, $this->options["mediaGalCatID"]); ?>><?php echo $cat->cat_name; ?></option>
								<?php } ?>
								</select>
								<label for="cp_mediaGalCatID">Select a category for Media Gallery</label><br />
							</div>

							
							<h2>Miscellaneous</h2>
							<div class="innerBox">
								<select name="cp_enableAName" class="selectCat">
								<option value="1"<?php selected(1, $this->options["enableAName"]); ?>>Display author name before post excerpt</option>
								<option value="0"<?php selected(0, $this->options["enableAName"]); ?>>Hide author name before post excerpt</option>
								</select><br/>

								<select name="cp_enableDate" class="selectCat">
								<option value="1"<?php selected(1, $this->options["enableDate"]); ?>>Display post date before excerpt</option>
								<option value="0"<?php selected(0, $this->options["enableDate"]); ?>>Hide post date before excerpt</option>
								</select><br/>
								
								<h3>Footer Logo</h3>
								<select name="cp_enableLogoFot" class="selectCat">
								<option value="1"<?php selected(1, $this->options["enableLogoFot"]); ?>>Display site logo on site footer</option>
								<option value="0"<?php selected(0, $this->options["enableLogoFot"]); ?>>Do not display site logo on footer</option>
								</select><br/>
								<input class="inputN" name="cp_logoUrlFot" id="cp_logoUrlFot" type="text" value="<?php echo $this->options["logoUrlFot"]; ?>" /><label for="cp_logoUrlFot"> (if enabled) Footer Logo URL [Max Width: 135px - Max Height:40px]</label><br /><br /><br />
								
								<h3>Set up time/date format</h3>
								<input class="inputID" name="cp_dateFormat" id="cp_dateFormat" type="text" value="<?php echo $this->options["dateFormat"]; ?>" /><label for="cp_dateFormat">Date/Time format that is displayed after the main page post excerpts (Default F j Y) <a href="http://php.net/manual/en/function.date.php" target="_blank">See all operators</a></label><br />
								<input class="inputID" name="cp_timeFormat" id="cp_timeFormat" type="text" value="<?php echo $this->options["timeFormat"]; ?>" /><label for="cp_timeFormat">Date/Time format to display before entries on main page sidebar (Default h:i a) <a href="http://php.net/manual/en/function.date.php" target="_blank">See all operators</a></label><br />
								<input class="inputID" name="cp_dateFormatS" id="cp_dateFormatS" type="text" value="<?php echo $this->options["dateFormatS"]; ?>" /><label for="cp_dateFormatS">Date/Time format that is displayed on single post page (Default l, F jS, Y) <a href="http://php.net/manual/en/function.date.php" target="_blank">See all operators</a></label><br />
								<input class="inputID" name="cp_dateFormatA" id="cp_dateFormatA" type="text" value="<?php echo $this->options["dateFormatA"]; ?>" /><label for="cp_dateFormatA">Date/Time format that is displayed on archive pages (Default F jS, Y) <a href="http://php.net/manual/en/function.date.php" target="_blank">See all operators</a></label><br />
								<h3>Set up Featured Tab Titles (If left empty, default values will be displayed)</h3>
								<input name="cp_topBoxTitle" id="cp_topBoxTitle" type="text" value="<?php echo $this->options["topBoxTitle"]; ?>" /><label for="cp_topBoxTitle"> Subnews Top Box Title [Assigned category title will be displayed if this option is left empty]</label><br />
								<input name="cp_botBoxTitle" id="cp_botBoxTitle" type="text" value="<?php echo $this->options["botBoxTitle"]; ?>" /><label for="cp_botBoxTitle"> Subnews Bottom Box Title [Assigned category title will be displayed if this option is left empty]</label><br />
								<input name="cp_tabA1" id="cp_tabA1" type="text" value="<?php echo $this->options["tabA1"]; ?>" /><label for="cp_tabA1"> Anchor text for Tab #1 [Assigned category title will be displayed if this option is left empty]</label><br />
								<input name="cp_tabA2" id="cp_tabA2" type="text" value="<?php echo $this->options["tabA2"]; ?>" /><label for="cp_tabA2"> Anchor text for Tab #2 [Assigned category title will be displayed if this option is left empty]</label><br />
								<input name="cp_tabA3" id="cp_tabA3" type="text" value="<?php echo $this->options["tabA3"]; ?>" /><label for="cp_tabA3"> Anchor text for Tab #3 [Assigned category title will be displayed if this option is left empty]</label><br />
								<input name="cp_tabA4" id="cp_tabA4" type="text" value="<?php echo $this->options["tabA4"]; ?>" /><label for="cp_tabA4"> Anchor text for Tab #4 [Assigned category title will be displayed if this option is left empty]</label><br />
								<input name="cp_tabA5" id="cp_tabA5" type="text" value="<?php echo $this->options["tabA5"]; ?>" /><label for="cp_tabA5"> Anchor text for Tab #5 [Assigned category title will be displayed if this option is left empty]</label><br /><br />
								<h3>Other Settings</h3>
								<input class="inputID" name="cp_recentPosts" id="cp_recentPosts" type="text" value="<?php echo $this->options["recentPosts"]; ?>" /><label for="cp_recentPosts"> How many recent posts to be displayed on front page top sidebar tab</label><br />
								<input name="cp_feedURL" id="cp_feedURL" type="text" value="<?php echo $this->options["feedURL"]; ?>" /><label for="cp_feedURL"> Feedburner URL for RSS</label><br />
								<input name="cp_rotate" id="cp_rotate" type="text" value="<?php echo $this->options["rotate"]; ?>" /><label for="cp_rotate"> Enable auto rotation for featured section [enter either <strong>true</strong> or <strong>false</strong>]</label><br />
								<input name="cp_rotatetime" id="cp_rotatetime" type="text" value="<?php echo $this->options["rotatetime"]; ?>" /><label for="cp_rotatetime"> (If auto rotate enabled) Speed of the rotation between featured tabs (default 5000)</label><br />				
								
							</div>

							<h2>Manage Ads</h2>
							<div class="innerBox">
								<select name="cp_enable728" class="selectm">
								<option value="1"<?php selected(1, $this->options["enable728"]); ?>>Enable 728x90 ad spot above the site header</option>
								<option value="0"<?php selected(0, $this->options["enable728"]); ?>>Disable 728x90 ad spot above the side header</option>
								</select>
								<h3>728x90 [Top Ad Spot]</h3>
								<textarea class="textarea" name="cp_ad728x90" id="cp_ad728x90"><?php echo stripslashes($this->options["ad728x90"]); ?></textarea>

								<h3 style="margin:15px 0 0;">468x60 [Top Header Ad Spot]</h3>
								<textarea class="textarea" name="cp_adh468x60" id="cp_adh468x60"><?php echo stripslashes($this->options["adh468x60"]); ?></textarea>				

								<h3>300x250 [Mainpage Sidebar Top Ad]</h3>				
								<textarea class="textarea" name="cp_300x250_up" id="cp_300x250_up"><?php echo stripslashes($this->options["300x250_up"]); ?></textarea>
								
								<h3>300x250 [Mainpage Sidebar Middle Left Ad]</h3>	
								<textarea class="textarea" name="cp_300x250_middle"id="cp_300x250_middle"><?php echo stripslashes($this->options["300x250_middle"]); ?></textarea>

								<h3>300x250 [Mainpage Sidebar Bottom Ad]</h3>				
								<textarea class="textarea" name="cp_300x250_bottom" id="cp_300x250_bottom"><?php echo stripslashes($this->options["300x250_bottom"]); ?></textarea>				
								
								<h3>300x250 [Inner Page Top]</h3>
								<textarea class="textarea" name="cp_300x250InnerTop" id="cp_300x250InnerTop"><?php echo stripslashes($this->options["300x250InnerTop"]); ?></textarea>
								
								<h3>300x250 [Inner Page Bottom]</h3>
								<textarea class="textarea" name="cp_300x250InnerBot" id="cp_300x250InnerBot"><?php echo stripslashes($this->options["300x250InnerBot"]); ?></textarea>
								
								<select name="cp_enable468" class="selectm">
								<option value="1"<?php selected(1, $this->options["enable468"]); ?>>Enable 468x60 ad spot between article and comment form</option>
								<option value="0"<?php selected(0, $this->options["enable468"]); ?>>Disable 468x60 ad spot between of article and comment form</option>
								</select>
								<h3>468x60 [Inner Page, Between Post and Comments]</h3>
								<textarea class="textarea" name="cp_adi468x60" id="cp_adi468x60"><?php echo stripslashes($this->options["adi468x60"]); ?></textarea>
							</div>
						</div>
					</div>	
				</div>
				<!-- End Option -->
				<!-- Start System Info Panel -->
				<div class="tab ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide" id="headway-system-info-tab">
					<div id="panelLeft">
						<h2>System Info</h2>
						<div class="innerBox">	
						<h3 class="border-top">WordPress Version <span><?php global $wp_version; echo $wp_version; ?></span></h3>
							
											
							<h3 class="border-top">PHP Version<span><?php echo PHP_VERSION; ?></span></h3>
							
							
							<?php if(function_exists('mysql_get_server_info')){ ?>
							<h3 class="border-top">MySQL Version<span><?php echo mysql_get_server_info(); ?></span></h3>
							
							<?php } ?>
							
							<h3 class="border-top">Web Server Info<span><?php echo $_SERVER['SERVER_SOFTWARE']; ?></span></h3>
							
							
							<h3 class="border-top">Browser Info<span><?php echo $_SERVER['HTTP_USER_AGENT']; ?></span></h3>
							

							<h3 class="border-top">PHP cURL Support<span><?php echo (function_exists('curl_init')) ? 'Yes' : 'No'; ?></span></h3>
							
							
							<h3 class="border-top">PHP GD (Image Library) Support<span><?php echo (function_exists('gd_info')) ? 'Yes' : 'No'; ?></span></h3>
						</div>	
					</div>
				</div>
				<!-- End System Info Panel -->
				<!-- Start Help Config -->
				<div class="tab ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide" id="headway-system-help-tab">
					<div id="panelLeft">
						<h2>You can view image to config theme</h2>
						<div class="innerBox">	
							<img class="img_help_theme" src="<?php bloginfo("template_directory");?>/lib/img/widgets-mainpage.jpg"/>
						</div>
					</div>
				</div>
				<!-- End Help Config -->
		</div><!--tab-->
		<input type="submit" value="Save Changes &raquo;" name="cp_save" class="button-primary" />
		
	 </form>
 </div>
<?php }
}
/********************************************************
New Control Panel - Do not remove!
********************************************************/
$cpanel = new ControlPanel();
$trns_options = get_option('Transcript');
?>